package com.example.authsystem.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "用户登录请求")
public class LoginRequest {
    @Schema(description = "用户名或邮箱", example = "john_smith", required = true)
    private String username;

    @Schema(description = "手机号（11 位，以 1 开头）", example = "13800138000")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确，应为11位数字，以1开头")
    private String phone;

    @Schema(description = "密码", example = "password123", required = true)
    private String password;

    @Schema(description = "是否记住登录", example = "true")
    private Boolean rememberMe = false;

    public String getUsername() {
        return username;
    }

    public String getPhone() {
        return phone;
    }

    public String getPassword() {
        return password;
    }

    public Boolean getRememberMe() {
        return rememberMe;
    }
}